from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    # 点击首页
    def souye(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.ImageView").instance(13)')
        ele=self.find_yuanshu(loc)
        return ele
    # 点击搜索
    def sousuo1(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        ele=self.find_yuanshu(loc)
        return ele
    # 再次点击搜索
    def sousuo2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_yuanshu(loc)
        return ele
    # 输入内容：麻婆豆腐
    def shuru(self):
        loc=(By.ID,'com.xiachufang:id/search_edit_text')
        ele=self.find_yuanshu(loc)
        return ele
    # 点击搜索按钮
    def anniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.find_yuanshu(loc)
        return ele
    # 断言
    def duanyan(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="综合"]')
        ele=self.find_yuanshu(loc)
        return ele
    # 历史搜索
    def lishi(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="蛋黄酥"]')
        ele=self.find_yuanshu(loc)
        return ele